package com.heima.article.controller.v2;

import com.heima.article.service.ApArticleService;
import com.heima.common.constants.ArticleConstants;
import com.heima.model.article.dto.ArticleDto;
import com.heima.model.article.dto.ArticleHomeDto;
import com.heima.model.article.entity.ApArticle;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/v2/article")
public class ArticleControllerV2 {

    @Resource
    private ApArticleService apArticleService;

    /**
     * 首页默认加载
     * @param dto
     * @return
     */
    @PostMapping("load")
    public ResponseResult loadV2(@RequestBody ArticleHomeDto dto){
        return apArticleService.loadV2(dto,ArticleConstants.LOAD_TYPE_MORE);
    }

}
